package com.whl.sm.controller.system;


import com.whl.sm.common.result.Result;
import com.whl.sm.controller.BaseController;
import com.whl.sm.model.system.UserCpCom;
import com.whl.sm.service.system.UserCpComService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wuhaolun
 * @since 2021-10-10
 */
@RestController
@RequestMapping("/user-cp-com")
public class UserCpComController extends BaseController {

    @Autowired
    private UserCpComService userCpComService;

    @RequestMapping("/bindMagId/{comId}")
    public Result comMagUsersId(@PathVariable("comId") String comId){
        List<String> userIdList = userCpComService.userIdList(comId);
        return Result.ok(userIdList);
    }

    @RequestMapping("/bindUsers")
    public Result bindUsers(@RequestParam String comId, @RequestParam List<String> idList){
        userCpComService.bindMagUser(comId,idList);
        return Result.ok();
    }

}
